package com.lee.demosharding.controller;

import com.lee.demosharding.entity.Course;
import com.lee.demosharding.service.CourseService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author winston
 * @DateTime 2021/11/18
 */
@AllArgsConstructor
@RestController
@RequestMapping("/courses")
public class CourseController {
    private final CourseService courseService;

    @PostMapping
    public int add(@RequestBody Course course) {
        return courseService.add(course);
    }
}
